<!DOCTYPE html>
<html>
  <head>
    <title>Bootstrap 101 Template</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
    <link href="{$Think.const.COMMON_URL}/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <link rel="stylesheet" href="{$Think.const.COMMON_URL}/css/font-awesome.min.css">
    <script src="{$Think.const.COMMON_URL}/js/jquery-1.7.2.min.js"></script> 
    <script src="{$Think.const.COMMON_URL}/js/bootstrap.js"></script>
    <script src="{$Think.const.ADMIN_JS_URL}/admin.js"></script>
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
  </head>
  <body>

    <div class="tabbable">
	  <ul class="nav nav-tabs">
	  	<li class="active"><a href="#tab1" data-toggle="tab">电影分类管理</a></li>
	    <li><a href="#tab2" data-toggle="tab">增加分类</a></li>
	  </ul>
	   <div class="tab-content">
	   <div class="tab-pane active" id="tab1">
	     <table class="table table-bordered">
	      <form action="{:U('movieterm/deleteall')}" method="post" id="termform">
		  <thead>
		    <tr>
		      <th>ID名称</th>
		      <th>创建</th>
		      <th>中文名</th>
		      <th>英文名</th>
		      <th>管理操作</th>
		    </tr>
		  </thead>
		  <tbody>
		    {$termlist}
		    <tr><td colspan="5"><a class="btn btn-primary" onclick="checkall('1')">全选</a>&nbsp;&nbsp;<a class="btn btn-primary" onclick="checkall()">反选</a>&nbsp;&nbsp;<a class="btn btn-warning" onclick="allupdate()">批量修改</a>&nbsp;&nbsp;<a class="btn btn-warning" onclick="alldelete()">批量删除</a></td></tr>
		  </tbody>
		  </form>
		</table>
	   </div>
	   <div class="tab-pane" id="tab2">
	     <form class="form-horizontal" action="{:U('movieterm/addterm_post')}"  method="post">
					  <div class="control-group">
					    <label class="control-label" for="inputEmail">上级</label>
					    <div class="controls">
					      <select name="p_id">
					        <option value='0'>作为一级目录</option>
							{$addlist}  
						  </select>
					    </div>
					  </div>
					  <div class="control-group">
					    <label class="control-label" for="inputPassword">中文分类名称</label>
					    <div class="controls">
					      <input type="text"  placeholder="中文分类名称" name="term_name" >
					    </div>
					  </div>
					  <div class="control-group">
					    <label class="control-label" for="inputPassword">英文分类名称</label>
					    <div class="controls">
					      <input type="text" placeholder="英文名称" name="term_ename" >
					    </div>
					  </div>
					  <div class="control-group">
					    <label class="control-label" for="inputPassword">SEO标题</label>
					    <div class="controls">
					      <textarea rows="3" name="seo_title"></textarea>
					    </div>
					  </div>
					  <div class="control-group">
					    <label class="control-label" for="inputPassword">SEO关键字</label>
					    <div class="controls">
					      <textarea rows="3" name="seo_keywords"></textarea>
					    </div>
					  </div>
					  <div class="control-group">
					    <label class="control-label" for="inputPassword">关键字描述</label>
					    <div class="controls">
					      <textarea rows="3" name="seo_description"></textarea>
					    </div>
					  </div>
					  <div class="form-actions">
				      <button type="submit" class="btn btn-primary  js-ajax-submit">保存</button>
				      <button type="reset" class="btn btn-warning  js-ajax-submit">重置</button>
				    </div>
			  </form>
	   </div>
	   </div>
	 </div>
	 <!-- 信息删除确认删除和批量修改模态弹窗 -->  
	<div class="modal fade" id="delcfmModel">  
	  <div class="modal-dialog">  
	    <div class="modal-content message_align">  
	      <div class="modal-header">  
	        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>  
	        <h4 class="modal-title">提示信息</h4>  
	      </div>  
	      <div class="modal-body">  
	        <p>您确认要删除吗？</p>  
	      </div>  
	      <div class="modal-footer">  
	         <input type="hidden" id="url"/>  
	         <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>  
	         <a  onclick="submittoggle()" class="btn btn-success" data-dismiss="modal">确定</a>  
	      </div>  
	    </div><!-- /.modal-content -->  
	  </div><!-- /.modal-dialog -->  
	</div><!-- /.modal --> 
    
    <script type="text/javascript">
  //根据传入的值确定是哪一种删除
    function submittoggle(){
    	var toggleid = $('#toggleid').val();
    	if(toggleid == 1){
    		var url=$.trim($("#url").val());//获取会话中的隐藏属性URL  
    	    window.location.href=url;
    	}else if(toggleid == 2){
    		var $deleteurl = "{:U('movieterm/deleteall')}";
    		formsubmit($deleteurl);
    	}else{
    		var $updateurl = "{:U('movieterm/updateall')}";
    		formsubmit($updateurl);
    	}       
    } 
	</script>
  </body>
</html>